{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<div class="uk-margin-small-top">
		{volist name=":get_model_func('MemberAddress', 'list_data', ['userid'=>$_userid])" id="v"}
		<div class="addres-card tm-df-size">
			<div class="main-content">
				<div class="tm-label">
					<div class="tm-flex">
						<div class="tm-flex-1">
							<span>收货人：{$v.consignee}</span>
						</div>
						<div>
							<span>{$v.phone}</span>
						</div>
					</div>
				</div>
				<div class="tm-label-no">
					<div class="tm-inline-1-3">
						收货地址：{$v.city} {$v.address}
					</div>
				</div>
				<div class="tm-flex-row">
					<div class="tm-flex flex-pack-end">
						<div class="main-ide-group">
							<div class="tm-flex">
								<a href="javascript:;" class="tm-icon-item tm-icon-btn cocoAjax" confirm="确认删除该收货地址？" ajax-url="{:url('v1/adminuser/del_address')}" ajax-data="{ id:{$v.id}}" ajax-callback="suc_del">
									<div class="tm-icon">
										<img src="{$images_path}del.png" alt="" width="16" height="16" />
									</div>
									<div class="tm-icon-label tm-font-gray">
										删除
									</div>
								</a>
								<a href="{:url('edit_address', ['id'=>$v.id])}" class="tm-icon-item tm-icon-btn href">
									<div class="tm-icon">
										<img src="{$images_path}ide.png" alt="" width="16" height="16" />
									</div>
									<div class="tm-icon-label tm-font-gray">
										编辑
									</div>
								</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{/volist}
	</div>
</div>
<!--layer-->
<div id="layer" style="display: none;">
	<div class="tm-layer-header tm-default-size tm-font-default">
		<div class="tm-label-lg">
			<div class="uk-text-center tm-inline-1-5 tm-df-size tm-font-bold">
				确认删除该收货地址？
			</div>
		</div>
	</div>
	<div class="tm-layer-body">
	</div>
	<div class="tm-layer-footer">
		<div class="tm-label-lg">
			<div class="main-content-md">
				<div class="to-btn-group">
					<ul class="uk-grid">
						<li class="uk-width-1-2">
							<button id="close-layer" type="button" class="mui-btn mui-btn-block">取消</button>
						</li>
						<li class="uk-width-1-2">
							<button type="button" class="mui-btn mui-btn-green mui-btn-block">确定</button>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function suc_del(obj, data) {
		$(obj).parent().parent().parent().parent().parent().parent().remove();
		coco_msg('删除成功');
	}
	function suc_back(obj, data) {
		coco_refresh_window();
	}
</script>
<script type="text/javascript">
    $(function(){
        c3_navtive_user.right_button_item1 = {
            title:"添加",
            callback:function(){
                var content = new Array();
                content['url'] = "{$app_url}/index/member/add_address";
                content['target'] = "blank";
                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
            }
        };
        var button_item = [
            {
                title: "添加",
                returnTag:'1'
            }
        ];
        {if !isset($isphone)}
            c3_navtive_user.doActionFunc("configMenu",button_item,function(datas){
                returntag = eval('(' + datas + ')');
                if(returntag.returnTag == 1){
                    var content = new Array();
	                content['url'] = "{$app_url}/index/member/add_address";
	                content['target'] = "blank";
	                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
                }
                else if(returntag.returnTag == 2){
                    c3_navtive_user.doActionAnsy('openSearch',null,function(){});
                }
            });
        {/if}
    })
</script>
{/block}